package com.ys.everydaynews.ui.main.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

class MainTabListAdapter(
    fm: FragmentManager,
    fragments: MutableList<Fragment>,
    titles: Array<String>
) : FragmentPagerAdapter(fm) {
    private val fragments: MutableList<Fragment> = fragments
    private val titles: Array<String> = titles
    override fun getCount(): Int = fragments.size

    override fun getItem(position: Int): Fragment = fragments[position]

    override fun getPageTitle(position: Int): CharSequence? =titles[position]

}